package com.utf999.qiangmanger.entity.orm;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.utf999.qiangmanger.entity.UUIDEntity;

/**
 * 公司信息
 * @author yinwenjie
 */
@Entity
@Table(name="B_Company")
public class CompanyEntity extends UUIDEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 7964492216370538016L;
	
	/**
	 * 公司名称
	 */
	@Column(name="companyName" , length=255 , unique=true , nullable=false)
	private String companyName;
	
	/**
	 * 公司商标原图的访问路径
	 */
	@Column(name="companyURL" , length=255 , nullable=false)
	private String companyURL = "";
	
	/**
	 * 创建时间
	 */
	@Column(name="createTime" , nullable=false)
	private Date createTime;
	
	/**
	 * 行业类型：
	 * 101、KTV
	 * 102、酒店住宿
	 * 103、夜场
	 * 104、其他
	 */
	@Column(name="industryType" , nullable=false)
	private Integer industryType = 101;
	
	/**
	 * 公司状态信息<br>
	 * 1、正常
	 * 0/其他值、作废
	 */
	@Column(name="status" , nullable=false)
	private Integer status = 1;
	
	/**
	 * 记录了属于该公司的所有管理员的集合
	 */
	@OneToMany(fetch=FetchType.LAZY , mappedBy="company")
	private Set<AdminUserEntity> admins;
	
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCompanyURL() {
		return companyURL;
	}

	public void setCompanyURL(String companyURL) {
		this.companyURL = companyURL;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getIndustryType() {
		return industryType;
	}

	public void setIndustryType(Integer industryType) {
		this.industryType = industryType;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Set<AdminUserEntity> getAdmins() {
		return admins;
	}

	public void setAdmins(Set<AdminUserEntity> admins) {
		this.admins = admins;
	}
	
	/* (non-Javadoc)
	 * @see com.utf999.qiangmanger.entity.UUIDEntity#getUniqueKey()
	 */
	@Override
	public String getUniqueKey() {
		return "uid";
	}
}
